home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / sw_42a.zip / SW42DEMO.BAT < prev   
DOS Batch File  |  1992-02-29  |  7KB  |  294 lines

  1. @ECHO OFF
  2. rem A pre-SW screen just for effect
  3. rem make sure the screen is default white on black
  4. rem reset border
  5. sw /o
  6. rem save existing prompt
  7. set sav=%prompt%
  8. rem make sure there was room in environment
  9. if "%sav%"=="" goto skip
  10. set prompt=$e[0m$p$g
  11. @echo on
  12. cls
  13. @echo off
  14. echo.
  15. echo.
  16. echo.
  17. echo.
  18. echo.
  19. echo.
  20. echo.
  21. echo                           Are Your Batch Files Dull?
  22. echo.
  23. echo                                    Lifeless?
  24. echo.
  25. echo                                     Boring?
  26. echo.
  27. echo                              SW.EXE is the answer!
  28. echo.
  29. echo.
  30. echo.
  31. echo.
  32. echo.
  33. echo.
  34. echo.
  35. echo.
  36. pause
  37. set prompt=%sav%
  38. set sav=
  39.  
  40. :skip
  41. rem skip over screen definitions
  42. rem Put screen definitions at the beginning of the file for fastest execution
  43. goto begin
  44.  
  45. rem Screen definition with default label
  46. rem Windows are drawn in the order defined. Pause, Query and User Input will
  47. rem occur as they are encountered. SW will return only the last Query result.
  48.  
  49. :Display
  50. _window /kcya┼ /r2 /s /bred /w /0 /z
  51. SW.EXE - Expanded Text Handling!
  52. /tWHI+ Multiple Windows!
  53. /m  v 4.2 
  54. _window /r10 /s /bwhi /gblu /l1 /fred /0
  55. /tBLU Optional Command Line Syntax:
  56. SW @filename [label]
  57. _window /r16 /s /bwhi /gblu /l1 /fred /0
  58. /tBLU SW 4.x ADDITIONAL FEATURES
  59. /tred /─
  60. /jl "- Define the entire screen with multiple windows  "
  61.   using external text files.
  62. _window /r25 /l0 /0 /p100- /d
  63. " - Press any key for more - "
  64. _window /r19 /bwhi /gblu /l0 /jl /0 /p100-
  65. "- Using labels, more than one definition can be   "
  66.   included in the same file.
  67. _window /r19 /bwhi /gblu /l0 /jl /0 /p100-
  68. "- The screen definition can be included inside the"
  69.   calling batch file!
  70. _window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /a2
  71. "- ~N~E~W~!  SW can now evaluate Environment Variables "
  72.   included inside screen definitions.
  73. _window /r25 /l0 /0 /p200- /d
  74. " - Press any key to continue - "
  75. :end_display
  76.  
  77. rem screen definition showing a menu with user defined label
  78.  
  79. :Snd_menu
  80. _window /kcya▐▄▀▄▀▄▀▌ /kCYA /r3 /s /bred /w /0 /z
  81. SW.EXE - New Sounds!
  82. /m " v 4.2 "
  83. _window /eRED /r11 /s /l1 /w
  84. /mc ┤ Play a Sound ├
  85. "~Low Tone   ~Mid Tone   ~High Tone"
  86. "Bweep ~1    Bweep ~2    ~Bomb     "
  87. "~Siren      ~Phasor     ~Tweeter  "
  88. /tYEL /─
  89. Close ~Encounters   ~Charge 
  90. ~WZLX
  91. /m < ~E~S~C >
  92. :end_Snd_menu
  93.  
  94. rem screen definition showing a menu with another user defined label
  95.  
  96. :4.2
  97. _window /kwhi░▒▓ /r4 /bred /w /0 /o /z
  98. SW.EXE - Bye, Bye ECHO!
  99. /m  v 4.2 
  100. _window /tRED /r11 /fWHI
  101. They can also be placed anywhere on the screen they'll fit!
  102. _window /c1 /r1 /tCYA /fBLU /bcya /l1 /0 /s1
  103. Upper Left
  104. _window /c71 /r1 /tMAG /fGRE /bmag /l1 /0 /s2
  105. Upper Right
  106. _window /c71 /r23 /tblu /fBLA /bgre /l1 /0 /s4
  107. Lower Right
  108. _window /c1 /r23 /tcya /fMAG /byel /l1 /0 /s3
  109. Lower Left
  110. _window /r18 /fWHI /tYEL+ /b4 /l5
  111. (c) 1992   Warren Small
  112. _window /r25 /l0 /0 /p100-
  113. " - Pausing 10 seconds - "
  114. _window /r25 /l0 /0 /p2
  115. " - or less! - "
  116. :end_4.2
  117.  
  118. :Charge
  119. _window /aC4,2
  120. _window /aF4,2
  121. _window /aA4,2
  122. _window /aC5,4
  123. _window /aA4,2
  124. _window /aC5,5
  125. :End_Charge
  126.  
  127. :Close
  128. _window /aA4,3
  129. _window /aB4,3
  130. _window /aG4,3
  131. _window /aG3,3
  132. _window /aD4,10
  133. :End_Close
  134.  
  135. :WZLX
  136. _window /aE5
  137. _window /aG5
  138. _window /aB5
  139. _window /aE6
  140. _window /aB5
  141. _window /aG5
  142. _window /aE5
  143. :End_WZLX
  144.  
  145. rem labels for Alert sounds demos near the beginning of file 
  146. rem for faster execution
  147.  
  148. :beep1
  149. sw /a1
  150. goto BeepDemo
  151.  
  152. :beep2
  153. sw /a2
  154. goto BeepDemo
  155.  
  156. :beep3
  157. sw /a3
  158. goto BeepDemo
  159.  
  160. :beep4
  161. sw /a4
  162. goto BeepDemo
  163.  
  164. :beep5
  165. sw /a5
  166. goto BeepDemo
  167.  
  168. :beep6
  169. sw /a6
  170. goto BeepDemo
  171.  
  172. :beep7
  173. sw /a7
  174. goto BeepDemo
  175.  
  176. :beep8
  177. sw /a8
  178. goto BeepDemo
  179.  
  180. :beep9
  181. sw /a9
  182. goto beepdemo
  183.  
  184. :beep10
  185. sw @sw42demo.bat charge
  186. goto beepdemo
  187.  
  188. :beep11
  189. sw @sw42demo.bat close
  190. goto beepdemo
  191.  
  192. :beep12
  193. sw @sw42demo.bat WZLX
  194. goto beepdemo
  195.  
  196. rem Alternate errorlevel check using FOR loop
  197.  
  198. :beepdemo
  199. sw /q^~lmh12bsptcew
  200. for %%e in (1 2 3 4 5 6 7 8 9 10 11 12) do if errorlevel %%e goto beep%%e
  201. if errorlevel 0 goto DI
  202.  
  203. rem Command line examples, positioning, colors, shadows, pause, Wide edge
  204. rem Color numbers are used to shorten the line
  205. rem Command line cannot exceed 128 characters
  206.  
  207. :begin
  208. sw /kwhi /r2 /s /bred "SW.EXE - Enhance Your Batch Files!" /0 /w /m " v 4.2 " /o /z
  209. sw /r10 /l1 /bcya /fRED "In it's simplest form, SW displays your text" "in a window in the center of the screen."
  210. sw /r18 /l3 /t11 "Display up to 20 lines" /t14 "- each with its own color -" /t12 "in one window!" /0
  211. sw /r25 /l0 /0 " - Press any key to continue - " /p100-
  212.  
  213. rem More command line examples, justify, borders
  214.  
  215. sw /kcya░ /r2 /s /bred "SW.EXE - Add Color to Your BAT's!" /tYEL "So easy to use!" /w /0 /m " v 4.2 " /z
  216. sw /fbla /byel /l4 /r10 "Other parameters allow different window colors," "double spacing, and 5 different borders" /2
  217. sw /b7 /r19 /g4 /l "Clear the screen with color" "using an optional character for texture" "& make windows with shadows." /0 /s
  218. sw /bwhi /r19 /gyel /l0 /0 /c4 /jl " Justify " " Text" " Left"
  219. sw /bwhi /r19 /gyel /l0 /0 /c66 /jr " Justify " "Text " "Right "
  220. sw /r25 /l0 /0 " - Press any key to continue - " /p100-
  221.  
  222. set colr=bla
  223. rem Make sure there was room in the environment
  224. if "%colr=="" goto next
  225.  
  226. rem Another command line example, Query with default, Border Message, Draw
  227. rem Draw a full screen window
  228. sw /r125 /c180 /o1 " "
  229. sw /r3 /s /bred "SW.EXE - Flow Control for BAT's!" /w /0 /m " v 4.2 " /z
  230.  
  231. rem The following line is longer than 128 characters BUT it works because 
  232. rem when the line is processed by DOS, the %colr% variable is replaced by
  233. rem the color value making the command line 3 characters shorter.
  234.  
  235. :colors
  236. sw /e12 /r13 /b%colr% /s /mc /t14 "▌ Pick a Color ▐" "~Brown  ~Cyan  ~White  ~Green" "Press ~E~S~C to go on..." /q^~bcwg /2 /l5 /d
  237.  
  238. if errorlevel 4 set colr=gre
  239. if errorlevel 4 goto colors
  240. if errorlevel 3 set colr=whi
  241. if errorlevel 3 goto colors
  242. if errorlevel 2 set colr=cya
  243. if errorlevel 2 goto colors
  244. if errorlevel 1 set colr=yel
  245. if errorlevel 1 goto colors
  246.  
  247. :next
  248. set colr=
  249.  
  250. rem Display screen definition with default label
  251. sw @sw42demo.bat
  252.  
  253. rem Display screen definition in external file
  254. sw @sw-42.new
  255.  
  256. rem Display screen definition with label 'menu'
  257. sw @sw42demo.bat Snd_menu
  258.  
  259. rem Query is handled separately beacause I wanted to return to the menu
  260. rem after processing the response without redoing the screen.
  261. rem I also placed it nearer the top of the file to speed it up.
  262. goto beepdemo
  263.  
  264. rem create screen definition on the fly to demo DI.EXE
  265. :DI
  266. if exist di.hlp goto DI_Display
  267. sw /r15 /l1 /0 /s /bwhi /fBLU /gblu "Standby!" "Building Next Screen"
  268. echo rem This file was created by SW42DEMO.BAT > di.hlp
  269. echo rem If simply viewing this file, Try the following command at the DOS prompt >> di.hlp
  270. echo rem                       "SW @DI.HLP" >> di.hlp
  271. echo.>> di.hlp
  272. echo :Display >> di.hlp
  273. echo _window /kmag▒─┼─▒ /s /bred /r2 /0 /w >> di.hlp
  274. echo SW.EXE - Now with DI!>> di.hlp
  275. echo /mc  v 4.2 >> di.hlp
  276. echo _window /jl /s /0 /r9 >> di.hlp
  277. echo /mc  Disk Information >> di.hlp
  278. echo.>> di.hlp
  279. di >> di.hlp
  280. echo. >> di.hlp
  281. echo _window /r25 /bblu /l0 /0 /p300- >> di.hlp
  282. echo  - Press any key to continue - >> di.hlp
  283. echo :End_Display >> di.hlp
  284. :DI_Display
  285. sw @di.hlp
  286.  
  287. rem Display screen definition with label '4.2'
  288. :final
  289. sw @sw42demo.bat 4.2
  290.  
  291. rem display help screen
  292. :help
  293. sw
  294.